﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VkontakteSharp;
using VkontakteSharp.Model;

namespace VkontakteSharp.Endpoints.Photos {
    public class Authenticated : VkontakteAPI
    {
        public Authenticated(VkontakteConfig config, string authInfo) : base(config,authInfo, "/photos.") { }

        public Response<List<Photo>> GetById(string[] postsIds, bool extended = false)
        {
            return (Response<List<Photo>>)Mapper.Map<Response<List<Photo>>>(GetByIdJson(postsIds, extended));
        }

        public string GetByIdJson(string[] postsIds, bool extended = false)
        {
            string uri = string.Format(base.Uri + "getById?oauth_token={0}&photos={1}",
                AuthInfo,String.Join(",", postsIds));
            if (extended)
            {
                uri += "&extended=1";
            }
            return HttpClientOld.GET(uri);
        }

    }
}
